﻿using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;
using VS.Documents.Views;
using VS.Infrastructure;

namespace VS.Documents
{
    public class Module : IModule
    {
        [Dependency]
        public IRegionManager RegionManager { get; set; }

        [Dependency]
        public IUnityContainer Container { get; set; }

        public void Initialize()
        {
            Container.RegisterInstance<DocumentViewModel>(new DocumentViewModel(), new ContainerControlledLifetimeManager());
            //Container.RegisterType<object, DocumentView>("documents");            
            RegionManager.RegisterViewWithRegion(RegionNames.AdminDocumentRegion, typeof(DocumentView));
        }
    }
}
